from Base import Base
from selenium.webdriver.common.by import By
import time
class Page1(Base):
    # 点击 请登录
    login_loc=(By.XPATH,'/html/body/div[2]/div/div[1]/div/a[1]')
    def login(self):
        self.click(self.login_loc)
    # 输入 用户名和密码
    username_loc=(By.NAME,'uname')
    password_loc=(By.NAME,'_pwd')
    def username(self):
        self.send_keys(self.username_loc,'19525482253')
        self.send_keys(self.password_loc,'123456Aa')
    # 点击 登录按钮
    login1_loc=(By.XPATH,'//*[@id="save"]')
    def login1(self):
        self.click(self.login1_loc)
    # 点击确定按钮
    sure_loc=(By.XPATH,'//*[@id="bindSub"]')
    def sure(self):
        self.click(self.sure_loc)
    # 断言1 jxw559459788
    dy1_loc=(By.XPATH,'/html/body/div[2]/div/div[1]/div/p/span')
    def dy1(self):
        return self.text(self.dy1_loc)

    def jiuxian_login(self):
        self.open_url('https://www.jiuxian.com/')
        # 请登录
        self.login()
        #输入用户名密码
        self.username()
        time.sleep(6)
        #点击登录按钮
        self.login1()
        # 点击确定按扭
        self.sure()
        time.sleep(3)
        #断言
        self.dy1()
        print(self.dy1())
        assert self.dy1() == "jxw559459788"
